home *** CD-ROM | disk | FTP | other *** search
/ Mac Mania 2 / MacMania 2.toast / Demo's / Music⁄Sounds / BeepSay 1.0.1 / Utilities.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-06-03  |  2.0 KB  |  84 lines  |  [TEXT/MPS ]

  1. /******************************************************************************
  2. **
  3. **  Folder Name:    BS
  4. **     File Name:    Utilities.c
  5. **
  6. **   Copyright:    © 1993 by Siren Enterprises, all rights reserved.
  7. **
  8. **   Description:    Support Routines for Lil´ BeepSay
  9. **
  10. *******************************************************************************
  11. **                       A U T H O R   I D E N T I T Y
  12. *******************************************************************************
  13. **
  14. **    Initials    Name
  15. **    --------    -----------------------------------------------
  16. **    kw            Ken Wieschhoff
  17. **
  18. *******************************************************************************
  19. **                      R E V I S I O N   H I S T O R Y
  20. *******************************************************************************
  21. **
  22. **      Date        Time    Author    Description
  23. **    --------    -----    ------    ---------------------------------------------
  24. **    05/17/93    21:02    kw        Original version
  25. **
  26. ******************************************************************************/
  27.  
  28. #include    <OSUtils.h>
  29. #include    <Files.h>
  30. #include    <Types.h>
  31. #include    <Resources.h>
  32. #include    <script.h>
  33. #include    <GestaltEqu.h>
  34. #include    <traps.h>
  35. #include    <errors.h>
  36. #include    <PLStringFuncs.h>
  37. #include    <Folders.h>
  38. #include    <Packages.h>
  39. #include    "Utilities.h"
  40.  
  41. extern pascal void ShowStr( StringPtr str);
  42. extern pascal void ShowStrNum( StringPtr str, OSErr err);
  43.  
  44. #define BTstQ(arg, bitnbr)        (arg & (1 << bitnbr))
  45.  
  46.  
  47.  
  48. //••••••••••••••••••••••••••••••••••••••••••••••••
  49. //•••••••••••••• A5 routines••••••••••••••••••••••
  50. //••••••••••••••••••••••••••••••••••••••••••••••••
  51. OSErr MakeA5World(register Handle A5Ref)
  52. {
  53.     OSErr    err;
  54.     
  55.     SetHandleSize(A5Ref, A5Size());
  56.     err = MemError();
  57.     
  58.     if (err == noErr) {
  59.         MoveHHi(A5Ref);
  60.         HLock(A5Ref);
  61.         A5Init((Ptr)( StripAddress(*A5Ref) + A5Size() - 32));
  62.     }
  63.     return( err);
  64. }
  65.  
  66.  
  67. long SetA5World(register Handle    A5Ref)
  68. {
  69.     return(SetA5((long)StripAddress(*A5Ref) + A5Size() - 32));
  70. }
  71.  
  72.  
  73. void RestoreA5World(register long oldA5)
  74. {
  75.     SetA5(oldA5);
  76. }
  77.  
  78.  
  79. void DisposeA5World(register Handle    A5Ref)
  80. {
  81.     HUnlock(A5Ref);
  82.     DisposHandle(A5Ref);
  83. }
  84.